<template>
	<div>
		<detail-banner :sightName="sightName" :bannerImg="bannerImg" :gallaryImgs="gallaryImgs"></detail-banner>
		<detail-header></detail-header>
		<div class="content">
			<detail-list :list="list"></detail-list>
		</div>
	</div>
</template>

<script>
	import axios from 'axios'
	import detailHeader from './components/Header'
	import detailBanner from './components/Banner'
	import detailList from './components/List'
	export default {
		name: 'Detail',
		data() {
			return {
				sightName: '',
				bannerImg: '',
				gallaryImgs: [],
				list: [],
			};
		},
		components: {
			detailHeader,
			detailBanner,
			detailList,
		},
		methods: {
			getDetailInfo() {
				axios.get('/api/detail.json', {
					params: {
						id: this.$route.params.id
					}
				}).then(this.handleGetDataSucc)
			},
			handleGetDataSucc(res) {
				res = res.data;
				this.sightName = res.data.sightName;
				this.bannerImg = res.data.bannerImg;
				this.gallaryImgs = res.data.gallaryImgs;
				this.list = res.data.categoryList
				console.log(res)
			}
		},
		mounted() {
			console.log(this.$route)
			this.getDetailInfo();
		}
	}
</script>

<style>
	.content{
		height: 50rem;
	}
</style>
